﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EntityFrameworkTest.aspx.cs" Inherits="ADO.NET.Samples.Web.EntityFrameworkTest" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=DB_SQL_ServerEntities" 
        DefaultContainerName="DB_SQL_ServerEntities" EnableDelete="True" 
        EnableFlattening="False" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="Articles" EntityTypeFilter="Article" 
        Where="" AutoGenerateWhereClause="True">
        <WhereParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="UserID" 
                PropertyName="SelectedValue" Type="Int32" DefaultValue="0" />
        </WhereParameters>
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSource2" runat="server" 
        ConnectionString="name=DB_SQL_ServerEntities" 
        DefaultContainerName="DB_SQL_ServerEntities" EnableFlattening="False" 
        EntitySetName="Users">
    </asp:EntityDataSource>
    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
        DataSourceID="EntityDataSource2" DataTextField="UserName" 
        DataValueField="UserID">
    </asp:DropDownList>
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
        BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" 
        DataKeyNames="ArticleID" DataSourceID="EntityDataSource1" ForeColor="Black" 
        GridLines="Vertical">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowSelectButton="True" />
            <asp:BoundField DataField="ArticleID" HeaderText="ArticleID" ReadOnly="True" 
                SortExpression="ArticleID" />
            <asp:BoundField DataField="ArticleTitle" HeaderText="ArticleTitle" 
                SortExpression="ArticleTitle" />
            <asp:BoundField DataField="ArticleContent" HeaderText="ArticleContent" 
                SortExpression="ArticleContent" />
            <asp:BoundField DataField="UserID" HeaderText="UserID" 
                SortExpression="UserID" />
            <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" 
                SortExpression="CategoryID" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
</asp:Content>
